package edu.yctc.origin.constant;

/**
 * 返回值枚举
 * 
 * @author 赵宜珺
 *
 */
public class ResultCode {

    /** 成功 */
    public static final int SUCCESS = 1;
    public static final String MSG_SUCCESS = "success";

    // 业务中细分的code 1000-1999
    /** 用户未登录 */
    public static final int USER_NOT_SIGN_IN = 1000;
    public static final String MSG_USER_NOT_SIGN_IN = "user not sign in";

    /** 登陆错误 */
    public static final int SIGN_IN_ERROR = 1001;
    public static final String MSG_SIGN_IN_ERROR = "sign in error";

    /** 无用户错误 */
    public static final int NO_SUCH_USER = 1002;
    public static final String MSG_NO_SUCH_USER = "no such user";

    /** 密码错误 */
    public static final int PASSWORD_ERROR = 1003;
    public static final String MSG_PASSWORD_ERROR = "password error";

    /** 账号或密码错误 */
    public static final int INCORRECT_NUMBER_OR_PASSWORD = 1004;
    public static final String MSG_INCORRECT_NUMBER_OR_PASSWORD = "incorrect number of password";

    /** 库存不足 */
    public static final int LACK_OF_STOCK = 1005;
    public static final String MSG_LACK_OF_STOCK = "lack of stock";

    /** 无该图书 */
    public static final int NO_SUCH_BOOK = 1006;
    public static final String MSG_NO_SUCH_BOOK = "no such book";

    /** 已存在该书(书编唯一索引) */
    public static final int ALREADY_EXIST_THE_BOOK = 1007;
    public static final String MSG_ALREADY_EXIST_THE_BOOK = "already exist the book";

    /** 邮箱不存在 */
    public static final int NO_SUCH_MAIL = 1008;
    public static final String MSG_NO_SUCH_MAIL = "no such mail";

    // 一些可能共性的异常code 9000~9999
    /** 接口已下线 */
    public static final int INTERFACE_OFFLINE = 9000;
    public static final String MSG_INTERFACE_OFFLINE = "interface is offline";

    /** 数据库错误 */
    public static final int DB_ERROR = 9001;
    public static final String MSG_DB_ERROR = "db error";

    /** 参数非法 */
    public static final int PARAMETER_INVALID = 9002;
    public static final String MSG_PARAMETER_INVALID = "parameter invalid";

    /** 非法访问 */
    public static final int ILLEGAL_ACCESS = 9003;
    public static final String MSG_ILLEGAL_ACCESS = "illegal access";

    /** 外键约束 */
    public static final int FOREIGN_KEY_CONSTRAINT = 9004;
    public static final String MSG_FOREIGN_KEY_CONSTRAINT = "foreign key constraint";

    /** 系统错误 */
    public static final int ERROR_SYSTEM_EXCEPTION = 9999;
    public static final String MSG_ERROR_SYSTEM_EXCEPTION = "system error";

}
